<!DOCTYPE html>
<html>
<head>
    <title>其它外包</title>
    <meta charset=utf-8>
    <meta name=viewport content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="../../../../start/layui/css/layui.css">
    <script type="text/javascript" src="../../../../start/layui/layui.js"></script>

</head>
<body>
    <!--第二部分总体设置-->
    <form class="layui-form" action="hahahaha">
        <div class="layui-row">
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1">

          <div class="layui-inline">
                        <label class="layui-form-label">托运单号：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input  disabled="disabled" type="text"  id="checkenumber"  placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
      </div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
                        <label class="layui-form-label">货物单号：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input disabled="disabled" type="text" name="freightinformation" id="goodsnumber"  placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">外包类型：</label>
          <div class="layui-input-inline" style="width:160px;">
              <input disabled="disabled"  type="text" name="type" id="outsourcingtype"  value="其它外包" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
                        <label class="layui-form-label">操作员：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input disabled="disabled" type="text"  id="operateyuan"  placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
  </div>
<hr class="layui-border-cyan">
  <div style="width: 100%;height: 40px;">
    <dd style="text-align-last: center;font-size:16px;">外包信息</dd>
</div>
<hr class="layui-border-cyan">

  <div class="layui-row" style="margin-top:10px">
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">外包订单：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input type="text" name="outsourcingId" id="outsourcingId" lay-verify="required" placeholder="请以6230为头" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
                        <label class="layui-form-label">外包公司：</label>
                        <div class="layui-input-block" style="width:160px;">
                                        <select name="logisticsId" id="logisticsId"  lay-search="">
                                            <option value=""></option>
                                        </select>
                                    </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">外包单号：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input type="text" name="outsourcingorder" id="outsourcingorder" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
                        <label class="layui-form-label">外包运费：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input type="text" name="freight" id="freight" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
  </div>

  <div class="layui-row" style="margin-top:10px">
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">外包现收：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input type="text" name="outsourcingNowclosed" id="outsourcingNowclosed" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
      <label class="layui-form-label">支付方式</label>
      <div class="layui-input-inline" style="width:160px;">
        <select name="modepayment" id="modepayment" lay-verify="required" lay-search="">
          <option value="1">移动支付</option>
          <option value="2">微信</option>
          <option value="3">支付宝</option>
          <option value="4">银行汇款</option>
          <option value="5">网银支付</option>
          <option value="6">现收</option>
          <option value="7">第三方代付</option>
          <option value="8">货到付款</option>
          <option value="9">信用卡</option>
        </select>
      </div>
    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">总收</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input type="text" name="recycle" id="recycle" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
                        <label class="layui-form-label">转包日期：</label>
                        <div class="layui-input-block" style="width:160px;">
                            <input type="text" name="subcontractdate" id="subcontractdate" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
  </div>
  <div class="layui-row" style="margin-top:10px">
    <div class="layui-col-xs12">
      <div class="grid-demo grid-demo-bg1">
      <div class="layui-form-item layui-form-text" style="width:380px;">
                    <label class="layui-form-label">外包备注</label>
                    <div class="layui-input-block">
                        <textarea  name="remark" id="remark" placeholder="" class="layui-textarea"></textarea>
                    </div>
                </div></div>
    </div>
  </div>
  <div class="layui-row" style="margin-top:10px">
    <div class="layui-col-xs12">
      <div class="grid-demo">

            <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo" style="align-items: center">保存录单</button>
            <button type="reset" class="layui-btn layui-btn-primary" style="align-items: center">重置</button>
        </div>
    </div>
      </div>
    </div>
  </div>

    </form>
</body>
<script>
    layui.use(['form', 'layedit', 'laydate','table'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,table = layui.table;
            var $ = layui.jquery;
            //日期初始化
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#subcontractdate'
        });

        /*外包公司下拉框赋值*/
        $.ajax({
            url:"../../queryLogistics",
            success:function(data){
                for(var i =0;i<data.length;i++){
                    $("#logisticsId").append("<option value='"+data[i].logisticsId+"'>"+data[i].forwardingunit+"</option>");
                    //重新渲染
                    form.render("select");
                }
            }
        });

        //监听提交：提交事件
        form.on('submit(formDemo)', function(data){
            $.ajax({
                type:'post'
                ,url:'../../../../addoutsourcing'
                ,data:data.field
                ,success:function(obj) {
                    if(obj.length>0){
                        parent.layer.close(1); //再执行关闭
                        //修改成功后刷新父界面
                        window.parent.location.reload();
                    }
                }
            });
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
</script>
</html>